﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualBasic;
using static Coldairarrow.Entity.Interface.YDOrdersDTO;
using Microsoft.Extensions.Options;
using Castle.Core.Internal;
using Coldairarrow.Util;

namespace Coldairarrow.Entity.Interface
{
    /// <summary>
    /// 订单列表
    /// </summary>
    /// 
    public class WB_OrdersDTO
    {

        /// <summary>
        /// 订单列表
        /// </summary>
        public List<Orders> orders { get; set; }
        /// <summary>
        /// 下一页的编码
        /// </summary>
        public long next { get; set; }

        public class Orders
        {
            public string RowId { get; set; }
            /// <summary>
            /// 状态
            /// </summary>
            public string status_S
            {
                get; set;

            }
            /// <summary>
            /// 物流状态
            /// </summary>
            public string status { 
                get; set; 
            
            }

            /// <summary>
            /// 买家状态
            /// </summary>
            public string supplierStatus
            {
                get; set;

            }
            /// <summary>
            /// 送货地址
            /// </summary>
            public string address { get; set; }
            /// <summary>
            /// 扫描价格
            /// </summary>
            public string scanPrice { get; set; }
            /// <summary>
            /// 买家评论
            /// </summary>
            public string comment { get; set; }
            /// <summary>
            /// 销售类型
            /// </summary>
            public string deliveryType { get; set; }
            /// <summary>
            /// 供应商ID
            /// </summary>
            public string supplyId { get; set; }
            /// <summary>
            /// 下单ID
            /// </summary>
            public string orderUid { get; set; }
            /// <summary>
            /// SKU
            /// </summary>
            public string article { get; set; }
            /// <summary>
            /// 颜色代码
            /// </summary>
            public string colorCode { get; set; }
            /// <summary>
            /// 唯一订单ID
            /// </summary>
            public string rid { get; set; }
            /// <summary>
            /// 创建日期
            /// </summary>
            public string createdAt { get; set; }
            /// <summary>
            /// 发货日期
            /// </summary>
            public string shipmentDate { get; set; }
            /// <summary>
            /// 卖家仓库
            /// </summary>
            private List<string> offices_;
            public List<string> offices
            {

                get { return offices_; }
                set
                {
                    if (!value.IsNullOrEmpty() && value.Count > 0)
                    {
                        offices_S = string.Join(",", value);
                        offices_ = value;
                    }
                    else
                    {
                        offices_S = "";
                        offices_ = new List<string>();
                    }

                }

            }
            public string offices_S { get; set; }

            /// <summary>
            /// 产品条码阵列
            /// </summary>

            private List<string> skus_;
            public List<string> skus
            {
                get { return skus_; }
                set
                {
                    if (!value.IsNullOrEmpty() && value.Count > 0)
                    {
                        skus_S = string.Join(",", value);
                        skus_ = value;
                    }
                    else
                    {
                        skus_S = "";
                        skus_ = new List<string>();
                    }

                }
            }
            public string skus_S { get; set; }
            /// <summary>
            ///  装配订单ID
            /// </summary>
            public string id { get; set; }
            /// <summary>
            /// 仓库ID
            /// </summary>
            public string warehouseId { get; set; }
            /// <summary>
            /// nmId
            /// </summary>
            public string nmId { get; set; }
            /// <summary>
            /// 产品尺寸ID
            /// </summary>
            public string chrtId { get; set; }
            /// <summary>
            /// 售价
            /// </summary>
            public string? price { get; set; }
            /// <summary>
            /// 转换价格
            /// </summary>
            public string? convertedPrice { get; set; }
            /// <summary>
            /// 转换币别
            /// </summary>
            public string currencyCode { get; set; }
            /// <summary>
            /// 转换币别
            /// </summary>
            public string convertedCurrencyCode { get; set; }
            /// <summary>
            /// 货物类型
            /// </summary>
            public string cargoType_;
            public string cargoType
            {
                get { return cargoType_; }


                set
                {
                    if (value == "1") cargoType_ = "小件商品";
                    else if (value == "2") cargoType_ = "ODC（超尺寸货物）";
                    else if (value == "3") cargoType_ = "CD+（尺寸货物+）";
                    else cargoType_ = value;
                }


            }
            /// <summary>
            /// 下单库存是否零
            /// </summary>
            public string isZeroOrder { get; set; }
            /// <summary>
            /// 业务类型
            /// </summary>
            public Options options_;
            public Options options
            {
                get { return options_; }
                set
                {
                    if (!value.IsNullOrEmpty())
                    {
                        options_S = value.isB2B;
                        options_ = value;
                    }
                    else
                    {
                        options_S = "";
                        options_ = new Options();
                    }

                }
            }

            public string options_S { get; set; }
            /// <summary>
            /// WB仓库ID
            /// </summary>
            public string officeId { get; set; }

            /// <summary>
            /// 品牌
            /// </summary>
            public string Brand { get; set; }

            /// <summary>
            /// 产品类型
            /// </summary>
            public string PrdType { get; set; }
            public class Options
            {
                public string isB2B_;
                public string isB2B
                {
                    get { return isB2B_; }


                    set
                    {
                        if (value == "true") isB2B_ = "B2B销售";
                        else isB2B_ = "非B2B销售";
                    }


                }
            }
        }
    }

}
